<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style></style>
</head>
<body>
    <button>取消</button>
    <button>支付</button>
</body>
<script>
    const btn1 = document.getElementsByTagName('button')[0];
    const btn2 = document.getElementsByTagName('button')[1];
    window.addEventListener(
        // 点击支付按钮
        btn2.onclick = function(){
            const su = confirm('你确定支付吗');
            if(su == true){ 
                location.href = 'sucess.html';
            }
        }
    )
</script>
</html>